Some Properties of Query Languages for Bags

نویسندگان

  • Leonid Libkin
  • Limsoon Wong
چکیده

In this paper we study the expressive power of query languages for nested bags. We deene the ambient bag language by generalizing the constructs of the relational language of Breazu-Tannen, Buneman and Wong, which is known to have precisely the power of the nested relational algebra. Relative strength of additional polynomial constructs is studied, and the ambient language endowed with the strongest combination of those constructs is chosen as a candidate for the basic bag language, which is called BQL (Bag Query Language). We prove that achieveing the power of BQL in the relational language amounts to adding simple arithmetic to the latter. We show that BQL has shortcomings of the relational algebra: it can not express recursive queries. In particular, parity test is not deenable in BQL. We consider augmenting BQL with powerbag and structural recursion to overcome this deeciency. In contrast to the rela-tional case, where powerset and structural recursion are equivalent, the latter is stronger than the former for bags. We discuss problems with using structural recursion and suggest a new bounded loop construct which works uniformly for bags, sets and lists. It has the power of structural recursion and does not require any preconditions to be veriied. We nd relational languages equivalent to BQL with powerbag and structural re-cursion/bounded loop. Finally, we discuss orderings on bags for rigorous treatment of partial information. 1 Summary Sets and bags are closely related structures. While sets have been studied intensively by the theoretical database community, bags have not received the same amount of attention. However, real implementations frequently use bags as the underlying data model. For example, the \select distinct" construct and the \select average of column" construct of SQL can be better explained if bags instead of sets are used. In an earlier paper 5], Breazu-Tannen, Buneman, and Wong deened a language based on monads 20, 29] and structural recursion 3] for querying sets. In section 2 of this report, the same syntax is given a bag-theoretic semantics. We use this language as our ambient bag language

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Algebraic Properties of Bag Data Types

We explore the implications of supporting bags (i.e. multisets) in a data model and associated query language, and present some formal results concerned with the algebraic properties of bags. We extend previous work to provide a formal basis for query optimization and for defining the appropriate semantics for bag operations in data models supporting ba.gs.

متن کامل

Database Theory Column Victor Vianu Query Languages for Bags Expressive Power and Complexity 1

One of the characteristics of advanced database systems is that they must handle data which no longer ts the traditional relational style. The present column summarizes recent results on one such extension, where databases handle bags (multisets) rather than just sets. The results illustrate an important research direction in Database Theory. Abstract Most database theory focused on investigati...

متن کامل

انتخاب مناسب‌ترین زبان پرس‌وجو برای استفاده از فرا‌‌پیوندها جهت استخراج داده‌ها در حالت دیتالوگ در سامانه پایگاه داده استنتاجی DES

Deductive Database systems are designed based on a logical data model. Data (as opposed to Relational Databases Management System (RDBMS) in which data stored in tables) are saved as facts in a Deductive Database system. Datalog Educational System (DES) is a Deductive Database system that Datalog mode is the default mode in this system. It can extract data to use outer joins with three query la...

متن کامل

Normal Forms and Conservative Extension Properties for Query Languages over Collection Types

Strong normalization results are obtained for a general language for collection types. An induced normal form for sets and bags is then used to show that the class of functions whose input has height (that is, the maximal depth of nestings of sets/bags/lists in the complex object) at most i and output has height at most o de nable in a nested relational query language without powerset operator ...

متن کامل

Query Languages for Bags and Aggregate Functions

Theoretical foundations for querying databases based on bags are studied in this paper. We fully determine the strength of many polynomial-time bag operators relative to an ambient query language. Then we obtain BQL, a query language for bags, by picking the strongest combination of these operators. The relationship between the nested relational algebra and various fragments of BQL is investiga...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993